package com.hw.core.system.repository;

import com.hw.core.system.entity.Course;
import com.hw.core.system.entity.CourseType;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.PageRequest;
import org.springframework.data.domain.Pageable;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
import org.springframework.data.jpa.repository.Query;
import org.springframework.data.repository.PagingAndSortingRepository;

import java.util.List;

public interface CourseRepository extends JpaRepository<Course, Integer> {


    Page<Course> findCourseByPIdIsNullAndStatusIs(Integer status,Pageable pageable);


    Page<Course> findCourseByPIdIsNullAndNameLikeOrderByName(String name,Pageable pageable);

    List<Course> findCourseByPIdEqualsOrderByName(Integer id);

    List<Course> findCourseByCourseTypesIn(List<CourseType> courseTypes);

    Page<Course> findCourseByPIdIsNullOrderByName(Pageable pageable);

}
